<?php
defined('IN_TS') or die('Access Denied.');

$tagname = urldecode(tsFilter($_GET['id']));

//$name=mb_convert_encoding($name,'UTF-8', 'GB2312');

$page = isset ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1;
$url = tsUrl ( 'ask', 'tag', array ('id'=>$tagname,'page' => '') );
$lstart = $page * 10 - 10;

$arrAsk = $new['ask']->findAll('ask_topic',"FIND_IN_SET('".$tagname."', tags) and `isaudit`='0'",'addtime desc',null,$lstart.',10');

if($arrAsk==''){
    header("HTTP/1.1 404 Not Found");
    header("Status: 404 Not Found");
    $title = '404';
    include pubTemplate("404");
    exit;
}

$askNum = $new ['ask']->findCount ( 'ask_topic', "FIND_IN_SET('".$tagname."', tags) and `isaudit`='0'");

$pageUrl = pagination ( $askNum, 10, $page, $url );

$title = $tagname;

$sitekey = $tagname;

include template('tag');